﻿<%@ Page Language="C#" Inherits="TPG.SharePoint.Workflow.TaskPage, TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Register TagPrefix="tpg" Namespace="TPG.SharePoint.Workflow.Controls" Assembly="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Import Namespace="TPG.SharePoint.Workflow" %>
<%@ Import Namespace="$rootnamespace$" %>

<%--add assembly reference here--%>
<%--<%@ Assembly Name="MyWorkflowLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken= " %>--%>

<asp:Content ID="PageTitle" ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server" >
</asp:Content>

<asp:Content ID="PageDescription" ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderId="PlaceHolderMain" runat="server">
  <asp:TextBox ID="MyTaskField" runat="server" /> <br />
  <asp:Button Text="Ok" OnClick="OkButton_Click" />
  <asp:Button Text="Cancel" OnClick="CancelButton_Click" />
</asp:Content>

<script runat="server" type="text/C#">
protected override void OnLoad(EventArgs e)
{
    if(IsInitialLoad)
    {
        TaskData taskData = GetWorkflowTaskData();
        MyTaskField.Text = (string)data["MyField"];
    }
    base.OnLoad(e);
}

protected void OkButton_Click(object sender, EventArgs e)
{
    TaskData taskData = new TaskData();
    taskData["MyField"] = MyTaskField.Text;
    CommitTask(taskData);
}

protected void CancelButton_Click(object sender, EventArgs e)
{
    CancelTask();
}
</script>